$(function () {
    $.ajax({
        url:"/orderManage/queryOrderById",
        type:"post",
        dataType:"json",
        success:function (r) {
            console.log(r);
            if (r!=null){
                let s = "";
                if (r[0].status==0){
                    s += "未审核";
                }else if (r[0].status==1){
                    s += "审核中";
                }else if (r[0].status==2){
                    s += "审核通过";
                }else if (r[0].status==3){
                    s += "审核未通过";
                }
                $("#orderinfo>li").eq(0).children("cite").html(r[0].orderid);
                $("#orderinfo>li").eq(1).children("cite").html(r[0].customname);
                $("#orderinfo>li").eq(2).children("cite").html(r[0].phone);
                $("#orderinfo>li").eq(3).children("cite").html(r[0].ordertime);
                $("#orderinfo>li").eq(4).children("cite").html(r[0].totalprice);
                $("#orderinfo>li").eq(5).children("cite").html(r[0].operatorname);
                $("#orderinfo>li").eq(6).children("cite").html(s);
                $("#orderinfo>li").eq(7).children("cite").html(r[0].opinion);
                $("#orderinfo>li").eq(8).children("cite").html(r[0].checkname);
                $("#orderinfo>li").eq(9).children("cite").html(r[0].checktime);
            }
            else{
                $("#orderinfo>li").html("");
            }
        }
    })

    $.ajax({
        url:"/orderManage/queryOrderDetailByOrderID",
        type:"post",
        datatype: "json",
        success:function (r) {
            console.log(r)
            var t = "";
            var i = 1;
            for (let j = 0; j < r.length; j++) {
                t += "<tr>\n" +
                    "          <td>"+(i++)+"</td>\n" +
                    "          <td >"+r[j].brandname+"</td>\n" +
                    "          <td>"+r[j].type+"</td>\n" +
                    "          <td>"+r[j].model+"</td>\n" +
                    "          <td>"+r[j].num+"</td>\n" +
                    "          <td>"+r[j].unit+"</td>\n" +
                    "          <td>"+r[j].price+"</td>\n" +
                    "          <td>"+r[j].totalprice+"</td>\n" +
                    "        </tr>";
            }
            $("#orderdetail").html(t);
        }
    })

})